-- SPDX-License-Identifier: GPL-3.0-or-later

local prefix = "packages.aaa_Romantic.pkg."

local ret = {} ---@type Package[]
local pack_names = {
  "rmt1st", "rmt2nd", "rmt3rd", "rmt4th", "rmt5th", "rmt6th", "r3d",
  "rmt_cards", "gamemodes",
}
for _, pack_name in ipairs(pack_names) do
  local pack = require (prefix..pack_name)
  table.insert(ret, pack)
  if pack.name == "gamemodes" then
    pack:addGameMode(require "packages.aaa_Romantic.pkg.gamemodes.1v2")
    pack:addGameMode(require "packages.aaa_Romantic.pkg.gamemodes.2v2")
    -- 置入全局技能
    pack:loadSkillSkelsByPath("./packages/aaa_Romantic/pkg/util/skills")
  end
end


local kingdoms = {}

for _, pack in ipairs(ret) do
  for _, general in ipairs(pack.generals) do
    table.insertIfNeed(kingdoms, general.kingdom)
    --- 将所有无技能的武将设置为隐藏
    if #general.other_skills == 0 then
      general:addSkill("rmt__empty")
      general.hidden = true
    end
  end
end

local ban_kingdoms = {"god"}
kingdoms = table.filter(kingdoms, function(v) return not table.contains(ban_kingdoms, v) end)

-- 将所有武将势力添加到神势力自选
if #kingdoms > 0 then
  Fk:appendKingdomMap("god", kingdoms)
end



Fk:loadTranslationTable{
  ["aaa_Romantic"] = "浪漫",
  -- 小包名
  ["rmt"] = "浪漫",
  ["rmt1st"] = "气贯虹霓",
  ["rmt2nd"] = "禾黍故宫",
  ["rmt3rd"] = "天下共逐",
  ["rmt4th"] = "华亭鹤唳",
  ["rmt5th"] = "锦绣江山",
  ["rmt6th"] = "瀛寰志略",
  ["r3d"] = "3D吧赛",
  -- 武将前缀
  ["rmtIf"] = "If",
  ["rmt1"] = "浪漫",
  -- 势力
  ["shang"] = "商",
  ["zhou"] = "周",
  ["han"] = "汉",
  ["qin"] = "秦",
  ["jin"] = "晋",
  ["song"] = "宋",
  ["qi"] = "齐",
  ["zhao"] = "赵",
  ["yan"] = "燕",
  ["tang"] = "唐",
  ["ghan"] = "韩",
  ["newdyn"] = "新",
  ["liang"] = "梁",
  ["west"] = "西",
  ["fuyao"] = "扶摇",
}

return ret
